Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for possible to wield completed craft #36230

Merged
merged 3 commits into from Dec 19, 2019
Merged

Check for possible to wield completed craft #36230

merged 3 commits into from Dec 19, 2019

Conversation

ghost
Copy link

@ghost ghost commented Dec 18, 2019

Summary

SUMMARY: Bugfixes "Check for possible to wield completed craft"

Purpose of change

Fixes #29928

Describe the solution

The completed craft did not check if it was possible to wield the resulting item, it attempted to do so, failed then didnt actually put the item anywhere.
Ive added a check, and if wielding fails due to wearing an item that restricts hands , or not having eonugh hands ( if the item requires two hands ) , and then drops it on the floor instead of just disappearing it.

Describe alternatives you've considered

N/A

Testing

linked issue was not really about moving away from the vehicle, but the presence of vehicle cargo spots may have hidden the issue.
tested this was the cause by removing swag bag, item completed fine.
after the fix, while wearing swag bag, crafting a forge ( which requires two hands ) was them dumped on the floor.

Additional context

N/A

src/crafting.cpp Outdated Show resolved Hide resolved
@ifreund ifreund added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling labels Dec 18, 2019
@Ramza13
Copy link
Contributor

Ramza13 commented Dec 18, 2019

So I can look up details later but I believe you want to be using the can_wield function rather than just checking for two handed flag as there are other cases where you can't wield something.

@ghost
Copy link
Author

ghost commented Dec 18, 2019

So I can look up details later but I believe you want to be using the can_wield function rather than just checking for two handed flag as there are other cases where you can't wield something.

yeah can_wield() just encapsulates the same checks, ill use that, its neater.

@ZhilkinSerg ZhilkinSerg merged commit 8d25275 into CleverRaven:master Dec 19, 2019
@ghost ghost deleted the disappearing_craft_fix branch December 19, 2019 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interrupted and moved intermediate crafting results vanishes after completion
3 participants